﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;
using System.Data.SqlClient;

public partial class gendan_chakan : System.Web.UI.Page
{
    protected List<Model.LotteryChippedUser> ChaKanlist = null;
    private int chakanid = ReadRequest.RequestInt("id");
    private int fqID = ReadRequest.RequestInt("UserID");
    protected int yh = ReadRequest.RequestInt("LotteryType");

    protected DataTable ChaKanfqr = null;
    protected DataTable ChaKancz = null;
    protected List<Model.LotteryChippedUser> farcklist = null;

    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            chakan();

        }

        cz();
         fqr();
        //BindData();
    }



    private void chakan() //查看
    {
        int totalCount4 = 0;
        PagedDataSource pds = new PagedDataSource();
       string sqlstr = " LotteryChippedid=" + chakanid + " ";
       ChaKanlist = BLL.LotteryChippedUser.GetPageListBysql(this.AspNetPager1.CurrentPageIndex - 1, this.AspNetPager1.PageSize, sqlstr, out totalCount4);
        if (ChaKanlist != null && ChaKanlist.Count > 0)
        {
            AspNetPager1.RecordCount = totalCount4;
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;

        }

    }
    public string yhName(object Uid)
    {
      
        Model.CMember cm = BLL.CMember.GetModel(Convert.ToInt32(Uid));
        if (cm != null)
        {
            return cm.nickname;//用户真实姓名
        }
        else
        {
            return "";
        }
    }
    private void fqr() //发起人
    {
        
        string sqlstr = "select CMember.nickname from CMember where CMember.Id=" + fqID + "";
        ChaKanfqr = BLL.LotteryChippedUser.GetPageListBysql(sqlstr);
    
    }

    private void cz() //彩种
    {
        string sqlstr = "select [LotteryType]   from [dbo].[LotteryChipped]";
        ChaKancz = BLL.LotteryChipped.GetPageListBysql(sqlstr);
    }

    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        chakan();

    }


}